<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/taglibs.jsp"%>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link href="${ctx}/resources/semantic/dist/semantic.min.css"
	rel="stylesheet" type="text/css" />
<link href="${ctx}/resources/semantic/dist/components/icon.min.css"
	rel="stylesheet" type="text/css" />
<link href="${ctx}/resources/apps.css" rel="stylesheet" type="text/css" />
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?63eb239345268c518caa9b38c60bfc89";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

<title>西门子医疗-销售精英的机会</title>

</head>
<body>
	<style type="text/css">

html, body, div, span, h1, h2, h3, h4, p, ul, li {
	margin: 0;
	padding: 0;
	border: 0px;
	vertical-align: baseline;
}

body {
	font-family: "Microsoft YaHei", "微软雅黑";
}

ol, ul {
	list-style: none;
}

blockquote, q {
	quotes: none;
}

blockquote:before, blockquote:after, q:before, q:after {
	content: '';
	content: none;
}

.top-view {
	height: 200px;
	background: url("${ctx}/resources/images/img/background.jpg") no-repeat;
	background-size: 100%;
	background-position: center;
	color: #fff;
	text-align: center;
}

.top-view .logo {
	padding-top: 40px;
}

.top-view .logo img {
	width: 70px;
}

.top-view .title {
	font-size: 18px;
	margin-top: 3px;
}

.top-view .list_content {
	margin-top: 5px;
}

.top-view .web_url {
	margin-top: 10px;
}

.top-view .menu {
	width: 28px;
	float: right;
	padding-right: 9px;
	margin-top: -8px;
}

.top-view .menu img {
	width: 100%;
	height: 100%;
}

.content {
	font-size: 14px;
}

.list {
	padding: 0 15px;
	margin-top: 11px;
}

.list .list_title {
	font-size: 16px;
	 color: #005bac; 
	font-weight:bold;
}

.list .list_title .redhead {
	color: #F67530;
	padding-right: 5px;
	font-weight:blod;
}

.list .list_content {
	line-height: 32px;
}

.list .list_content .content_title {
	padding-right: 40px;
}

.list .list_foot {
	font-size: 12px;
	margin-top: 10px;
}

.list .list_foot .bottom_icon {
	display: inline-block;
	width: 14px;
}


.list .list_foot .bottom_icon img {
	width: 100%;
	height: 100%;
}
#icon{
	margin-left:10px;
}
 
</style>
   
	<div class="top-view"  onclick="window.open('http://mp.weixin.qq.com/s/5E_EDr9cnvg4ZHpfufj17A','_self');">
	</div>
	<div class="ui segment" id="n-page" style="margin: 0rem 0;padding-bottom:0px;">
		<input type="hidden" id ="companyId" name="companyId" value = "${company.id}">
			<c:choose>
				<c:when test="${jobs == null or fn:length(jobs)==0 }">  没有相关职位信息    </c:when>
				<c:otherwise>
					<div class="ui middle aligned divided list" id="row-data">

						<c:forEach items="${jobs}" var="jd">
						
    					<div class="position" data-position-id="${jd.id}">
							<div class="list">
								<div class="list_title">
									<span class="redhead">[Hot]</span>${jd.name} (推荐奖金${jd.reward}K)
								</div>
								 <p class="list_content content">
									<span class="content_title">职责：${jd.majorDuty}</span>
								</p> 
								<div class="list_foot">
									<div class="bottom_icon">
										<img src="${ctx}/resources/images/img/location.png" alt="">
									</div>
									<span class="content_title" style="color:#F67530;">
									<%-- ${jd.city.name} --%>
								    <c:forEach items="${cities}" var="city">
										<c:choose>
											<c:when test="${jd.cityId == city.id }">
							           		 ${city.name}
							       		    </c:when>
										</c:choose>
									</c:forEach>
									</span>
									<div class="bottom_icon" id="icon" >
										<img  src="${ctx}/resources/images/img/update.png" alt="">
									</div>
									<span class="content_title"> ${jd.expiredDateStr}</span>
									<div class="bottom_icon" id="icon">
										<img src="${ctx}/resources/images/img/price.png" alt="">
									</div>
									<span class="content_title">极具竞争力的薪水</span>
								</div>
							</div>
							<br/>
							<div style="background-color: rgba(0,0,0,.12);height: 1px;width: 100%;"></div>
							
						</div>
						</c:forEach>
					</div>
				</c:otherwise>
			</c:choose>
		
	</div>
	<div></div>
	<input type="hidden" name="lastposition" id="lastposition"
		value="${fn:length(jobs)}" />
	<input type="hidden" name="hasmoredata" id="hasmoredata" value="yes" />


	<script src="${ctx}/resources/semanticui/jquery-2.1.4.min.js"></script>
	<script src="${ctx}/resources/semanticui/semantic.js"></script>
	 <script src="${ctx}/resources/jweixin-1.0.0.js"></script> 
	<script type="text/javascript">
	   wx.config({
	    debug: false, 
	    appId: "${config.appid}",  
	    timestamp: ${config.currenttimestamp},  
	    nonceStr: "${config.nonceStr}", 
	    signature: "${config.signatureStr}", 
	    jsApiList: ['checkJsApi',
	        'onMenuShareTimeline',
	        'onMenuShareAppMessage',
	        'onMenuShareQQ',
	        'onMenuShareWeibo',
	        'showOptionMenu']  
	});   
 
    var datasource = {
        moredata: function() {
           
            var offset  = $('#lastposition').val();
            var hasmore = $('#hasmoredata').val();
            var companyId = $('#companyId').val();
            var getUrl = '${ctx}/siemens/hotJob/more?companyId='+companyId;
            getUrl += "&offset=" + offset;

            if(hasmore != "yes"){
                alert("已经没有更多数据了");
                return false;
            }

            var that = this;

            $.ajax({ 
                    url: getUrl, 
                    type: "GET", 
                    success: function(data, status){ 
                        if(data.errorcode == 0) {
                            that.appenddata(data);
                        } else {
                            var errorUrl = '${ctx}/wechat/candidate/error.page';
                            location.href = errorUrl;
                        }
                    }, 
                    error: function(){ 
                        alert("服务出错，请稍后尝试"); 
                    } 
            });
        },

        appenddata:function(data) {
            var offset = parseInt($('#lastposition').val());
            var divstring = "";
            var jobs = data.jobs;

            var count = jobs.length;
            offset += parseInt(count);
            $('#lastposition').val(offset);
            if(count <10) {
                $('#hasmoredata').val('no');
            }
			for (var i in jobs) {
                var jd = jobs[i];
                divstring += "<div class='position' data-position-id='"+jd.id+"'> "
                divstring += "	<div class='list'> "
                divstring += "		<div class='list_title'> "
                divstring += "			<span class='redhead'>[Hot]</span>"+jd.name+"(推荐奖金" + jd.reward + "K)"
                divstring += "		</div> "
                divstring += "		<p class='list_content content'>"
                divstring += "			<span class='content_title'>描述：" + jd.majorDuty + "</span>"
                divstring += "		</p >"
                divstring += "		<div class='list_foot'> "
                divstring += "			<div class='bottom_icon'> "
                divstring += "				<img src='${ctx}/resources/images/img/location.png' alt= ''>"
                divstring += "			</div> "
                divstring += "			<span class='content_title' style='color:#F67530;'>" + jd.city.name+ "</span> "
                divstring += "			<div class='bottom_icon' id='icon'> "
                divstring += "				<img src='${ctx}/resources/images/img/update.png' alt=''>"
                divstring += "			</div> "
                divstring += "			<span class='content_title'> " + jd.expiredDateStr + "</span> "
                divstring += "			<div class='bottom_icon' id='icon'> "
                divstring += "				<img src='${ctx}/resources/images/img/price.png' alt=''> "
                divstring += "			</div> "
                divstring += "			<span class='content_title'>极具竞争力的薪水</span> "
                divstring += "		</div> "
                divstring += "	</div> "
                divstring += "</div> "
                divstring += "<br/>"
                divstring += "<div style='background-color: rgba(0,0,0,.12);height: 1px;width: 100%;'></div>  "

            }
            var newdata = $(divstring);
            $('#row-data').append(newdata);
        }
    };

   
	$(document).ready(function() { 
    	var l = sessionStorage.getItem('index_list');
   	 
    	if(null !== l && '' !== l){
    	    $("#row-data").html(l);
    	    $(window).scrollTop(sessionStorage.getItem('index_scroll'));
    	    page = sessionStorage.getItem('index_page');
    	    sessionStorage.removeItem('index_list');
    	    sessionStorage.removeItem('index_scroll');
    	}else{
    		datasource.moredata();
    	};	
    	
    	$(window).scroll(function() { 
              if($(window).scrollTop() == $(document).height() - $(window).height()) {
                  datasource.moredata();
              } 
         });
         
         $('#row-data').on('click','.position', function() {
        	 var offset = parseInt($('#lastposition').val());
             var positionid = $(this).attr('data-position-id');
             var getUrl = '${ctx}/siemens/job/viewDetail.page?jobId='+positionid;
             sessionStorage.setItem('index_list',$("#row-data").html());
             sessionStorage.setItem('index_page',offset);
             sessionStorage.setItem('index_scroll',$(window).scrollTop());
             window.location.href = getUrl;
         });
         
        wx.ready(function() { 
            wx.onMenuShareAppMessage({
                title: '西门子医疗招聘',  
                desc: '如何拿到全球顶级医疗公司的OFFER',  
                link: 'http://www.tiaonali.com${ctx}/siemens/job/listHotJobs.page',  
                imgUrl: 'http://www.tiaonali.com${ctx}/resources/images/share_logo.png',  
                type: 'link'
            });

            wx.onMenuShareTimeline({
                title: '西门子医疗招聘',  
                desc: '如何拿到全球顶级医疗公司的OFFER',  
                link: 'http://www.tiaonali.com${ctx}/siemens/job/listHotJobs.page',  
                imgUrl: 'http://www.tiaonali.com${ctx}/resources/images/share_logo.png'
            });

            wx.showOptionMenu();
            
        });
    });
</script>
</body>
</html>